array is an array value, expression or variable.
UBound returns a Number containing the largest available subscript for the given array.
Commonly used to obtain the size of an array before using a looping control mechanism to systematically manipulate elements of the array.
The following examples are for both Basic and Crystal syntax:
Rem Basic syntax
Dim simpleArray(10) As Number
formula = UBound(simpleArray)
//Crystal syntax
Local NumberVar Array simpleArray;
Redim simpleArray[10];
UBound(simpleArray)
Rem Basic syntax
Dim dateArray () As Date
dateArray = Array (CDate(#12/25/1998#), CDate(#12/24/1999#))
formula = UBound(dateArray)
//Crystal syntax
Local DateVar Array dateArray;
dateArray := [CDate(#12/25/1998#), CDate(#12/24/1999#)];
UBound (dateArray)
Note: Unlike Visual Basic, only 1 dimensional arrays are supported in Seagate Crystal Reports. Also, array subscripts start at 1 in Seagate Crystal Reports and not 0 as is the default in Visual Basic.
| Seagate Software, Inc. http://www.seagatesoftware.com Please send comments to: techpubs@seagatesoftware.com |